;var module = angular.module('CtrlsContent');
module.controller('InfoEditCtrl',['$scope','api_other','$state',function($scope,api_other,$state){
	$scope.selfModel = {};
	$scope.event = {
		get:function(obj){
			var obj = {
				userId:localStorage.bls_userId,
			}
			var pro = api_other.selfInfo(obj);
			pro.success(function(data){
				if(data.returnCode == 0){
					$scope.selfModel = data.returnData;
				}
			});			
		},
		set:function(obj){
			var obj = {
				userId:localStorage.bls_userId,
				name:obj.name,
				phone:obj.phone,
				address:obj.address

			}
			var pro = api_other.selfEdit(obj);
			pro.success(function(data){
				if(data.returnCode == 0){
					alert('保存成功');
					$state.go('main.myself');
				}
			});

		}
	}
	$scope.event.get();
}])